package com.dhcc.bpm.modules.api.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dhcc.bpm.modules.api.entity.ProductApi;
import com.dhcc.bpm.modules.api.vo.ProductApiVO;
import com.dhcc.bpm.modules.workflow.dto.ApiBO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName ProductApiMapper
 * @Description product_api表 Mapper 接口
 * @Author daina
 * @Date 2020/2/25 16:02
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 */
public interface ProductApiMapper extends BaseMapper<ProductApi> {

	/**
	 * @Description 自定义分页
	 * @Author daina
	 * @Date 15:04 2020/2/25
	 * @param page
	 * @param api
	 * @return java.util.List<com.dhcc.bpm.modules.api.vo.ProductApiVO>
	 **/
	List<ProductApiVO> selectProductApiPage(IPage page, ProductApiVO api);
    /**
     * @Description 查询关联api
     * @Author daina
     * @Date 15:05 2020/2/25
     * @param product_id
     * @return java.util.List<java.lang.String>
     **/
	List<String> selectRelatedApi(Long product_id);
    /**
     * @Description 更新
     * @Author daina
     * @Date 15:05 2020/2/25
     * @param product_id
     * @return int
     **/
	int updateDeleteRelate(Long product_id);
    /**
     * @Description 更新
     * @Author daina
     * @Date 15:05 2020/2/25
     * @param productApi
     * @return int
     **/
	int updateStatus(ProductApi productApi);
	/**
	 * @Description 更新
	 * @Author daina
	 * @Date 15:05 2020/2/25
	 * @param productApi
	 * @return int
	 **/
	int updateAllStatus(ProductApi productApi);
	/**
	 * @Description 查询关联api
	 * @Author daina
	 * @Date 15:05 2020/2/25
	 * @param productId
	 * @return java.util.List<com.dhcc.bpm.modules.workflow.dto.ApiBO>
	 **/
	List<ApiBO> listRelatedApi(@Param("productId") Long productId);
	/**
	 * @Description 查询产品api
	 * @Author daina
	 * @Date 15:04 2020/2/25
	 * @param productApi
	 * @return java.util.List<com.dhcc.bpm.modules.api.entity.ProductApi>
	 **/
	List<ProductApi> listProductApi(ProductApi productApi);


	List<ProductApiVO> listApiRelate(ProductApiVO productApi);
	/**
	 * @Description 查询关联api详情
	 * @Author daina
	 * @Date 15:04 2020/2/25
	 * @param productId
	 * @return java.util.List<com.dhcc.bpm.modules.workflow.dto.ApiBO>
	 **/
	List<ApiBO> listRelatedApiDetail(Long productId);
	/**
	 * @Description 删除
	 * @Author daina
	 * @Date 15:04 2020/2/25
	 * @param productApi
	 * @return int
	 **/
	int delete(ProductApi productApi);

	/**
	 * @Description 更新status by product_id,api_id
	 * @Author daina
	 * @Date 15:04 2020/2/25
	 * @param productApi
	 * @return int
	 **/
	int updateApiStatus(ProductApi productApi);

	/**
	 * @Description 查询所有api
	 * @Author sjm
	 * @Date 15:55 2020/3/10 0010
	 * @param id
	 * @return java.util.List<com.dhcc.bpm.modules.api.entity.ProductApi>
	 **/
    List<ProductApi> productApiList(Long id);
}
